<style type="text/css">
    #divIcon a{
        text-decoration: none; 
        color: green;
        font-size: 12px;

    }
    #divIcon a:hover {color: brown; font-size: 12px;}
    td{text-align: center; width: 50%;}
</style>
<?php
if ($this->session->userdata('addcategory_ms')) {
    echo $this->session->userdata('addcategory_ms');
    echo $this->session->unset_userdata('addcategory_ms');
}
echo'<div id="divIcon">';
echo '<fieldset style="margin: 0 auto;width:60%;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
echo'<legend align="center" style="magin:auto;"><div  style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 20px;color:#006600;">Sale Management</div></legend>';
echo '<table width="50%" border="0" cellspacing="1" cellpadding="7" align="center">';
echo '<tr><td>' . anchor('sale_management/add_material', (img(array('alt' => '', 'src' => 'images/user_images/meterials.png')))) . '<br />' . anchor('sale_management/add_material', 'Material') . '</td>';
//echo ' &nbsp;| &nbsp;';
echo '<td>' . anchor('product/addcategory', (img(array('alt' => '', 'src' => 'images/user_images/meterials_add.png')))) . '<br />' . anchor('product/addcategory', 'Add Material Category') . '</td></tr>';
echo '</table>';
echo '</fieldset>';
echo'</div>';

echo'<div id="divIcon">';
echo '<fieldset style="margin: 0 auto;width:60%;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
echo'<legend align="center" style="magin:auto;"><div  style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 14px;color:#006600;">View Management</div></legend>';
?>
<div class="webwidget_scroller_tab" id="webwidget_scroller_tab">
    <div class="tabContainer">
        <ul class="tabHead">
            <li class="currentBtn"><a href="javascript:;">Sale product </a></li>
            <li><a href="javascript:;">Sale Card</a></li>
            <li><a href="javascript:;">View Sale</a></li>

        </ul>
    </div>

    <div class="tabBody">
        <ul>
            <li class="tabCot">
                <p>
                <form>
                    <form><input type="text" /><input type="button" value="search"/></form>
                    <table class="mytable" border="0" width="100%">
                        <tr>
                            <?php
                            echo '<td>N&ordm;</td>';
                            echo '<td>Product Name</td>';
                            echo '<td>Price</td>';
                            echo '<td>Quantity</td>';
                            echo '<td >Sale_Date</td>';
                            echo '<td>Sale Type</td>';
                            echo '<td>Sub_Total</td>';
                            echo '<td style="width:10%">Action</td>';
                            ?>
                            <td style="width:10px;"></td>
                            <?php
                            /* $query=$this->db->query("SELECT tbs.*,tbsd.*,tbp.*,tbu.* FROM tbl_sale tbs 
                              INNER JOIN tbl_student tbsd ON tbs.stu_id = tbsd.stu_id
                              INNER JOIN tbl_user tbu ON tbs.use_id = tbu.use_id
                              INNER JOIN tbl_product tbp ON tbs.pro_id = tbp.pro_id"); */
                            //use for see material 
                            $J = 1;
                            foreach ($query->result() as $rows) {
                                echo '<tr style="text-align:center;font-weight: lighter;">';
                                echo '<td>' . $J . '</td>';
                                echo '<td>' . $rows->pro_name . '</td>';
                                echo '<td>$' . $rows->pro_price . '</td>';
                                echo '<td>' . $rows->pro_quantity . '</td>';
                                echo '<td>' . $rows->sal_date . '</td>';
                                echo '<td>' . $rows->use_username . '</td>';
                                echo '<td>' . $rows->pro_price * $rows->pro_quantity . '</td>';
                                echo '<td>' . anchor('sale_management/delete/' . $rows->car_id, 'Delete', 'title=Delete onclick="return confirm(\'Are you sure you want to delete?\')"') . '|', anchor('sale_management/edit/' . $rows->car_id, 'Edit') . '</td>';
                                echo '</tr>';
                                $J++;
                            }
                            ?>
                        </tr>
                    </table>

                </form>
                </p>
            </li>

            <li class="tabCot">
                <p>tab4 content</p>
            </li>

        </ul>
        <div style="clear:both"></div>
    </div>

    <div class="modBottom">
        <span class="modABL">&nbsp;</span><span class="modABR">&nbsp;</span>
    </div>
</div>
<?php
echo '</fieldset>';
echo'</div>';
?>